// JavaScript Document
 window.onload=function(){
			 	var oslider = document.getElementById('slider');
			 	var aImg = oslider.getElementsByTagName('img');
			 	var oBtn_left  = getByClass(document,'btn_left')[0];
			 	var oBtn_right  = getByClass(document,'btn_right')[0];
			 	var iNow = 0;
				setTime();
			 	var timer = null;
			 	oBtn_left.onclick=function(){
			 		iNow--;			
			 	    move();				 		
			 	}
			 	oBtn_right.onclick=function(){
			 		iNow++;		 		
			 	    move();
			 	}
				function setTime(){
			 	    timer=setInterval(function(){
			 		    iNow++;		 		
			 		    move();	 		
			 	    },3000)
				}
			 	function move(){
				    clearInterval(timer);				
			 		if(iNow<0){
			 			iNow=aImg.length-1;
			 		}			 		
			 		if(iNow == aImg.length){
			 			iNow=0;
			 		}
			 		for(var i=0;i<aImg.length;i++){
					      if(i!=iNow){						     
						     startMove(aImg[i],{opacity:0});
						  }                           						  
			 		}
					startMove(aImg[iNow],{opacity:100},function(){
						setTime();
					});                					
			 	}			 	
			 }